//
//  BJFourBtnTableViewCell.m
//  JuJinHuiRong
//
//  Created by APPLE on 16/11/7.
//  Copyright © 2016年 APPLE. All rights reserved.
//

#import "BJFourBtnTableViewCell.h"

#define BtnFont 15
#define BtnWidth BILIWIDTH(70)
#define BtnHeight BILIHEIGHT(70)

#define KongXi (ScreenWidth - BILIWIDTH(70) * 4) / 5
@implementation BJFourBtnTableViewCell

- (void)initUI{
    
    _wenXinBtn = [[BJButton alloc]initWithFrame:CGRectMake(KongXi, 0, BtnWidth, BtnHeight)];
    [_wenXinBtn addTarget:self action:@selector(didClickWeiXinBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    _wenXinBtn.tag = 10010011;
    _wenXinBtn.imageViews.image = [UIImage imageNamed:@"zhuanaaaa"];
    _wenXinBtn.titleLablees.text = @"专题教育";
    [self addSubview:_wenXinBtn];
    
   _tuiJianBtn = [[BJButton alloc]init];
    _tuiJianBtn.titleLablees.text = @"党史学习";
     _tuiJianBtn.tag = 10010012;
    _tuiJianBtn.imageViews.image = [UIImage imageNamed:@"dang"];

    [_tuiJianBtn addTarget:self action:@selector(didClickTuiJianYouJiangBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:_tuiJianBtn];
    [_tuiJianBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_wenXinBtn.mas_right).offset(KongXi);
        make.top.mas_equalTo(self.mas_top).offset(0);
        make.size.equalTo(_wenXinBtn);
    }];
    
    _qianDaoBtn = [[BJButton alloc]init];
    _qianDaoBtn.titleLablees.text = @"廉政教育";
    _qianDaoBtn.tag = 10010013;

    _qianDaoBtn.imageViews.image = [UIImage imageNamed:@"lianzheng"];

    [_qianDaoBtn addTarget:self action:@selector(didClickDayQianDaoBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:_qianDaoBtn];
    [_qianDaoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_tuiJianBtn.mas_right).offset(KongXi);
        make.top.mas_equalTo(self.mas_top).offset(0);
        make.size.equalTo(_wenXinBtn);
    }];

    _ziXunBtn = [[BJButton alloc]init];
    _ziXunBtn.titleLablees.text = @"精品课堂";
    _ziXunBtn.imageViews.image = [UIImage imageNamed:@"jing"];
    _ziXunBtn.tag = 10010014;

    [_ziXunBtn addTarget:self action:@selector(didClickCenterBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:_ziXunBtn];
    [_ziXunBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_qianDaoBtn.mas_right).offset(KongXi);
        make.top.mas_equalTo(self.mas_top).offset(0);
        make.size.equalTo(_wenXinBtn);
    }];
    
    _yaoWenBtn = [[BJButton alloc]init];
    _yaoWenBtn.titleLablees.text = @"时政要闻";
    _yaoWenBtn.imageViews.image = [UIImage imageNamed:@"shi"];
    _yaoWenBtn.tag = 10010015;

    [_yaoWenBtn addTarget:self action:@selector(didClickYaoWenBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:_yaoWenBtn];
    [_yaoWenBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_wenXinBtn);
        make.top.mas_equalTo(_wenXinBtn.mas_bottom).offset(BILIHEIGHT(10));
        make.size.equalTo(_wenXinBtn);
    }];
    
    _studyBtn = [[BJButton alloc]init];
    _studyBtn.titleLablees.text = @"学习测试";
    _studyBtn.imageViews.image = [UIImage imageNamed:@"xi"];
    _studyBtn.tag = 10010016;

    [_studyBtn addTarget:self action:@selector(didClickStudyBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:_studyBtn];
    [_studyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_tuiJianBtn);
        make.top.mas_equalTo(_tuiJianBtn.mas_bottom).offset(BILIHEIGHT(10));
        make.size.equalTo(_wenXinBtn);
    }];
    
    _dangTuanBtn = [[BJButton alloc]init];
    _dangTuanBtn.titleLablees.text = @"党团实务";
    _dangTuanBtn.imageViews.image = [UIImage imageNamed:@"tuan"];
    _dangTuanBtn.tag = 10010017;

    [_dangTuanBtn addTarget:self action:@selector(didClickDangTuanBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:_dangTuanBtn];
    [_dangTuanBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_qianDaoBtn);
        make.top.mas_equalTo(_qianDaoBtn.mas_bottom).offset(BILIHEIGHT(10));
        make.size.equalTo(_wenXinBtn);
    }];
    
    _allBtn = [[BJButton alloc]init];
    _allBtn.titleLablees.text = @"全部";
    _allBtn.imageViews.image = [UIImage imageNamed:@"else"];
    _allBtn.tag = 10010018;

    [_allBtn addTarget:self action:@selector(didClickAllBtn:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:_allBtn];
    [_allBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_ziXunBtn);
        make.top.mas_equalTo(_ziXunBtn.mas_bottom).offset(BILIHEIGHT(10));
        make.size.equalTo(_wenXinBtn);
    }];

    
    UILabel *label = [[UILabel alloc]init];
    label.backgroundColor = GrayLabel;
    [self addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.mas_bottom).offset(0);
        make.left.mas_equalTo(self.mas_left).offset(0);
        make.size.mas_equalTo(CGSizeMake(ScreenWidth, BILIHEIGHT(10)));
    }];
}

#pragma mark ---- 专题教育
- (void)didClickWeiXinBtn:(UIButton *)btn{
    _pushBlock(1);
}

#pragma mark ---- 党史学习
- (void)didClickTuiJianYouJiangBtn:(UIButton *)btn{
    _pushBlock(2);
}

#pragma mark ---- 廉政教育
- (void)didClickDayQianDaoBtn:(UIButton *)btn{
    _pushBlock (3);
}

#pragma mark ---- 精品课堂
- (void)didClickCenterBtn:(UIButton *)btn{
    _pushBlock (4);
}


#pragma mark ---- 专题教育
- (void)didClickYaoWenBtn:(UIButton *)btn{
    _pushBlock(5);
}

#pragma mark ---- 党史学习
- (void)didClickStudyBtn:(UIButton *)btn{
    _pushBlock(6);
}

#pragma mark ---- 廉政教育
- (void)didClickDangTuanBtn:(UIButton *)btn{
    _pushBlock (7);
}

#pragma mark ---- 精品课堂
- (void)didClickAllBtn:(UIButton *)btn{
    _pushBlock (8);
}

@end
